package exception;

import java.util.Comparator;

public class TryCatchDemo {
    public static void main(String[] args) {
//        System.out.println("程序开始了");
//        String str = null;
//        System.out.println(str.length());
//        System.out.println("程序结束了");

        System.out.println("程序开始了");
        try{
//            String str1 = null;
//            System.out.println(str1.length());
//            String str2 = "";
//            System.out.println(str2.charAt(0));
            String str3 = "a";
            System.out.println(Integer.parseInt(str3));
        }catch(StringIndexOutOfBoundsException e) {
            System.out.println("我解决了");
        }
//        }catch(Exception e){
//            System.out.println("这次解决了");
//        }
        System.out.println("程序结束了");





    }
}
